@tailwind base;
@tailwind components;
@tailwind utilities;

html, body {
  @apply h-full m-0;
  background-color: #1a1a1a;
}

#root {
  @apply h-full;
}

/* 滚动条样式 */
::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

::-webkit-scrollbar-track {
  background: #2d2d2d;
}

::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Select custom styles */
.custom-select .ant-select-selector {
  background-color: #374151 !important;
  border-color: #4B5563 !important;
  color: white !important;
  height: 24px !important;
  padding: 0 6px !important;
  font-size: 12px !important;
}

.custom-select .ant-select-selection-placeholder {
  color: #9CA3AF !important;
}

.custom-select .ant-select-selection-item {
  background-color: #4B5563 !important;
  border-color: #6B7280 !important;
  color: white !important;
}

/* 添加特定样式以确保多选标签在暗色主题下可见 */
.custom-select.ant-select-multiple .ant-select-selection-item {
  background-color: #4B5563 !important;
  border-color: #6B7280 !important;
  color: white !important;
  margin-top: 2px !important;
  margin-bottom: 2px !important;
}

/* 确保标签文本在Ant Design 4.x和5.x版本中都可见 */
.custom-select .ant-select-selection-item-content,
.custom-select .ant-select-selection-item-remove,
.custom-select .ant-select-selection-item .anticon,
.custom-select .ant-select-selection-item span {
  color: white !important;
}

/* 修复标签关闭按钮的样式 */
.custom-select .ant-select-selection-item .ant-select-selection-item-remove {
  color: rgba(255, 255, 255, 0.65) !important;
}

.custom-select .ant-select-selection-item .ant-select-selection-item-remove:hover {
  color: white !important;
}

.custom-select .ant-select-dropdown {
  background-color: #374151 !important;
  border: 1px solid #4B5563 !important;
}

.custom-select .ant-select-item {
  color: white !important;
}

.custom-select .ant-select-item-option-active {
  background-color: #4B5563 !important;
}

.custom-select .ant-select-item-option-selected {
  background-color: #6B7280 !important;
}

.custom-select .ant-select-selection-search input {
  color: white !important;
}

.custom-select .ant-select-clear {
  background-color: transparent !important;
  color: #9CA3AF !important;
}

.custom-select .ant-select-arrow {
  color: #9CA3AF !important;
}

/* Dark theme modal styles */
.dark-theme-modal .ant-modal-title {
  color: #e5e7eb !important;
}

.dark-theme-modal .ant-modal-close {
  color: #9CA3AF !important;
}

.dark-theme-modal .ant-modal-close:hover {
  color: #e5e7eb !important;
}

.dark-theme-list .ant-list-item {
  border-color: #374151 !important;
}

.dark-theme-list .ant-list-item:hover {
  background-color: #374151 !important;
}

.dark-theme-input {
  background-color: #1f2937 !important;
  border-color: #374151 !important;
  color: #e5e7eb !important;
}

.dark-theme-input::placeholder {
  color: #9CA3AF !important;
}

.dark-theme-input:hover,
.dark-theme-input:focus {
  border-color: #6366F1 !important;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2) !important;
}

/* Split pane styles */
.split {
  display: flex;
  flex-direction: row;
}

.gutter {
  background-color: #4B5563;
  cursor: col-resize;
  width: 2px !important;
}

.gutter:hover {
  background-color: #6B7280;
}

/* Custom input styles for dark mode */
.custom-input {
  background-color: #1F2937 !important;
  border-color: #4B5563 !important;
  color: #E5E7EB !important;
}

.custom-input::placeholder {
  color: #9CA3AF !important;
  opacity: 1 !important;
}

.custom-input:hover,
.custom-input:focus {
  border-color: #6366F1 !important;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2) !important;
}

.custom-input input {
  background-color: transparent !important;
  color: #E5E7EB !important;
}

.custom-input .anticon {
  color: #9CA3AF !important;
}

/* Dark mode table styles */
.dark-mode-table {
  background-color: transparent !important;
}

.dark-mode-table .ant-table {
  background-color: transparent !important;
}

.dark-mode-table .ant-table-thead > tr > th {
  background-color: #374151 !important;
  color: #ffffff !important;
  border-bottom: 1px solid #4B5563 !important;
}

.dark-mode-table .ant-table-tbody > tr > td {
  border-bottom: 1px solid #4B5563 !important;
  color: #ffffff !important;
}

.dark-mode-table .ant-table-tbody > tr:hover > td {
  background-color: #4B5563 !important;
}

.dark-mode-table .ant-table-row-expand-icon {
  background-color: #4B5563 !important;
  border-color: #6B7280 !important;
  color: #ffffff !important;
}

.dark-mode-table .nested-table {
  margin: 0 !important;
  padding: 0 !important;
}

.dark-mode-table .nested-table .ant-table-tbody > tr > td {
  background-color: #1F2937 !important;
}

.dark-mode-table .nested-table .ant-table-tbody > tr:hover > td {
  background-color: #374151 !important;
}

/* 为Ant Design 5.x添加额外兼容样式 */
.custom-select .ant-select-selection-overflow-item .ant-select-selection-item {
  background-color: #4B5563 !important;
  border-color: #6B7280 !important;
  color: white !important;
}

.custom-select .ant-select-selection-overflow-item .ant-select-selection-item-content {
  color: white !important;
}

.custom-select .ant-select-selection-overflow-item .ant-select-selection-item-remove {
  color: rgba(255, 255, 255, 0.65) !important;
}

.custom-select .ant-select-selection-overflow-item .ant-select-selection-item-remove:hover {
  color: white !important;
}

/* 下拉菜单深色主题样式 */
.dark-dropdown-menu {
  background-color: #1f2937 !important;
  border: 1px solid #374151 !important;
  color: #e5e7eb !important;
}

.dark-dropdown-menu .ant-select-item {
  color: #e5e7eb !important;
  background-color: #1f2937 !important;
}

.dark-dropdown-menu .ant-select-item-option-active {
  background-color: #374151 !important;
}

.dark-dropdown-menu .ant-select-item-option-selected {
  background-color: #3b82f6 !important;
  color: white !important;
}

.dark-dropdown-menu .ant-select-item-empty {
  color: #9ca3af !important;
}

.dark-dropdown-menu .ant-select-item-group {
  color: #9ca3af !important;
  font-weight: bold;
  padding: 8px 12px;
}

/* 文件选项样式 */
.file-option {
  transition: background-color 0.2s;
}

.dark-dropdown-menu .file-option {
  background-color: transparent !important;
}

.dark-dropdown-menu .file-option:hover {
  background-color: #374151 !important;
}

/* ================ 全局 Ant Design 暗色主题样式 ================ */

/* 暗色主题表格样式 */
.dark-table.ant-table-wrapper {
  background-color: #1e1e1e;
  color: #e0e0e0;
  border-radius: 6px;
}

.dark-table .ant-table {
  background-color: #1e1e1e !important;
  color: #e0e0e0 !important;
}

.dark-table .ant-table-container {
  background-color: #1e1e1e !important;
  border-radius: 6px;
}

.dark-table .ant-table-thead > tr > th {
  background-color: #2c2c2c !important;
  color: #e0e0e0 !important;
  border-bottom: 1px solid #383838 !important;
}

.dark-table .ant-table-tbody > tr > td {
  background-color: #1e1e1e !important;
  border-bottom: 1px solid #383838 !important;
  color: #e0e0e0 !important;
}

.dark-table .ant-table-tbody > tr.ant-table-row:hover > td {
  background-color: #2c2c2c !important;
}

/* 表格空状态 */
.dark-table .ant-empty {
  color: #a0a0a0 !important;
}

.dark-table .ant-empty-image svg {
  fill: #333333 !important;
}

.dark-table .ant-empty-description {
  color: #a0a0a0 !important;
}

.dark-table .ant-empty-footer {
  color: #a0a0a0 !important;
}

/* 修复空表格状态下的颜色 */
.model-table .ant-table-placeholder .ant-table-cell {
  background-color: #1e1e1e !important;
  color: #a0a0a0 !important;
  border-bottom: none !important;
}

.model-table .ant-empty-normal .ant-empty-image {
  height: 40px;
  margin-bottom: 8px;
}

/* 确保分页组件也使用暗色主题 */
.dark-table .ant-pagination {
  background-color: transparent !important;
  color: #e0e0e0 !important;
}

.dark-table .ant-pagination-item {
  background-color: #2c2c2c !important;
  border-color: #383838 !important;
}

.dark-table .ant-pagination-item a {
  color: #e0e0e0 !important;
}

.dark-table .ant-pagination-item-active {
  background-color: #177ddc !important;
  border-color: #177ddc !important;
}

.dark-table .ant-pagination-item-active a {
  color: white !important;
}

.dark-table .ant-pagination-prev button,
.dark-table .ant-pagination-next button {
  color: #e0e0e0 !important;
  background-color: #2c2c2c !important;
  border-color: #383838 !important;
}

/* 暗色主题模态框样式 */
.dark-modal .ant-modal-content {
  background-color: #1e1e1e;
  color: #e0e0e0;
  border-radius: 6px;
  box-shadow: 0 6px 16px -8px rgba(0, 0, 0, 0.6);
}

.dark-modal .ant-modal-header {
  background-color: #1e1e1e;
  border-bottom: 1px solid #383838;
  border-radius: 6px 6px 0 0;
}

.dark-modal .ant-modal-title {
  color: #e0e0e0;
}

.dark-modal .ant-modal-close {
  color: #a0a0a0;
}

.dark-modal .ant-modal-footer {
  border-top: 1px solid #383838;
}

/* 暗色主题表单样式 */
.dark-form .ant-form-item-label > label {
  color: #e0e0e0;
}

.dark-input {
  background-color: #2c2c2c;
  border-color: #434343;
  color: #e0e0e0;
}

.dark-input:hover, .dark-input:focus {
  border-color: #177ddc;
}

.dark-input::placeholder {
  color: #6c6c6c;
}

.dark-input[disabled] {
  background-color: #3a3a3a;
  color: #a0a0a0;
}

/* 暗色主题选择器样式 */
.dark-select .ant-select-selector {
  background-color: #2c2c2c !important;
  border-color: #434343 !important;
  color: #e0e0e0 !important;
}

.dark-select.ant-select-disabled .ant-select-selector {
  background-color: #3a3a3a !important;
  color: #a0a0a0 !important;
}

.dark-select .ant-select-arrow {
  color: #a0a0a0 !important;
}

/* 黑暗主题下拉菜单 - 全局覆盖 */
.ant-select-dropdown {
  background-color: #1e1e1e !important;
  border: 1px solid #383838 !important;
}

.ant-select-item {
  color: #e0e0e0 !important;
}

.ant-select-item-option-selected {
  background-color: #111b26 !important;
}

.ant-select-item-option-active {
  background-color: #2a2a2a !important;
}

/* 暗色主题按钮样式 */
.dark-button.ant-btn {
  border-color: #434343;
  background-color: #2c2c2c;
  color: #e0e0e0;
}

.dark-button.ant-btn:hover {
  border-color: #177ddc;
  color: #177ddc;
}

.dark-button.ant-btn-primary {
  background-color: #177ddc;
  border-color: #177ddc;
  color: #ffffff;
}

.dark-button.ant-btn-primary:hover {
  background-color: #1884e0;
  border-color: #1884e0;
}

.dark-button.ant-btn-dangerous {
  color: #ff4d4f;
  border-color: #ff4d4f;
}

.dark-button.ant-btn-dangerous:hover {
  background-color: #2c2c2c;
  color: #ff7875;
  border-color: #ff7875;
}

/* 暗色主题开关样式 */
.dark-switch.ant-switch {
  background-color: #434343;
}

.dark-switch.ant-switch-checked {
  background-color: #177ddc;
}

/* 暗色主题确认框 */
.dark-popconfirm .ant-popover-inner {
  background-color: #1e1e1e;
  border: 1px solid #383838;
}

.dark-popconfirm .ant-popover-title,
.dark-popconfirm .ant-popover-inner-content {
  color: #e0e0e0;
}

.dark-popconfirm .ant-popover-arrow-content {
  background-color: #1e1e1e;
}

/* 设置面板的选项卡样式 */
.settings-tabs .ant-tabs-nav {
  margin-bottom: 16px !important;
  background-color: #111827 !important;
  border-bottom: 1px solid #1e293b !important;
}

.settings-tabs .ant-tabs-tab {
  color: #a0a0a0 !important;
  padding: 8px 16px !important;
}

.settings-tabs .ant-tabs-tab:hover {
  color: #3b82f6 !important;
}

.settings-tabs .ant-tabs-tab.ant-tabs-tab-active .ant-tabs-tab-btn {
  color: #3b82f6 !important;
  font-weight: 500 !important;
}

.settings-tabs .ant-tabs-ink-bar {
  background-color: #3b82f6 !important;
}

.settings-tabs .ant-tabs-content {
  background-color: transparent !important;
}
